package juc.threadpool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author fangbin
 * @desc
 * @date 2020/5/13 21:30
 */
public class FixedThreadPoolOOM {
//-Xmx8m -Xms8m
    public static void main(String[] args) {

        ExecutorService executorService = Executors.newFixedThreadPool(1);
        ExecutorService executorService2 = Executors.newFixedThreadPool(1);
        for(int i=0;i<Integer.MAX_VALUE;i++){
            System.out.println(i);
            executorService.execute(new Task());
        }
    }
}
class Task implements Runnable{

    @Override
    public void run() {
        try {
            Thread.sleep(100000000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}